﻿<h3>ParentComponent01</h3>


@* 
父子相传 
*@
<p>String in Parent: @parentString</p>
<button onclick="@PassToChild">Pass String To Child</button>

<ChildComponent01 
        ToChild=@parentString
        FromChild=@ReceivedFromChild>    
</ChildComponent01>

@functions{
    private string parentString = "Initial Parent String";
    private void PassToChild()
    {
        parentString += "- To Child";
    }
    private void ReceivedFromChild(string str)
    {
        parentString = str;
        StateHasChanged();
    }
}
